package com.atguyigu.codesday01.dom01;

public class Ticket  { //类 = Field（变量） + method
    //定义张票数
   private  int numb = 50;

   //买票方法
   public synchronized void  sale (){
       if (numb >0){
           System.out.println(Thread.currentThread().getName()+"\t"+"卖出第:"+(numb--)+"\t 还剩下:"+numb);
       }
   }
}
